<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户中心管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/center/centerUser/">用户中心列表</a></li>
		<shiro:hasPermission name="center:centerUser:edit"><li><a href="${ctx}/center/centerUser/form">用户中心添加</a></li></shiro:hasPermission>
	</ul>
	<%--@elvariable id="centerUser" type="com.zcm.modules.center.entity.CenterUser"--%>
	<form:form id="searchForm" modelAttribute="centerUser" action="${ctx}/center/centerUser/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>登录名：</label>
				<form:input path="loginName" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>姓名：</label>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>手机：</label>
				<form:input path="mobile" htmlEscape="false" maxlength="200" class="input-medium"/>
			</li>
			<li><label>用户类型：</label>
				<form:select path="userType" class="input-medium">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('center_user_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>是否可登录：</label>
				<form:select path="auditFlag" class="input-medium">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('audit_flag')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>登录名</th>
				<%--<th>姓名</th>--%>
				<th>手机</th>
				<%--<th>用户类型</th>--%>
				<th>最后登陆IP</th>
				<th>最后登陆时间</th>
				<th>是否可登录</th>
				<th>注册时间</th>
				<shiro:hasPermission name="center:centerUser:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="centerUser">
			<tr>
				<td>
					<%--<a href="${ctx}/center/centerUser/form?id=${centerUser.id}"></a>--%>
					${centerUser.loginName}
				</td>
				<%--<td>--%>
					<%--${(empty centerUser.name)?"未完善":centerUser.name}--%>
				<%--</td>--%>
				<td>${fn:substring(centerUser.mobile,0,7)}****</td>
				<%--<td>--%>
					<%--${fns:getDictLabel(centerUser.userType, 'center_user_type', '')}--%>
				<%--</td>--%>
				<td>
					<c:if test="${not empty centerUser.loginDate}">
					<c:set var="ips" value='${fn:split(centerUser.loginIp,".")}'/>
					<c:if test="${fn:length(ips) ge 4}">
					${ips[0]}.${ips[1]}.${ips[2]}.*
					</c:if></c:if>
				</td>
				<td>
					<fmt:formatDate value="${(empty centerUser.loginDate)?centerUser.updateDate:centerUser.loginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${fns:getDictLabel(centerUser.auditFlag,"audit_flag","" )}
				</td>
				<td>
					<fmt:formatDate value="${centerUser.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<shiro:hasPermission name="center:centerUser:edit"><td>
    				<a href="${ctx}/center/centerUser/form?id=${centerUser.id}">修改</a>
					<a href="${ctx}/center/centerUser/delete?id=${centerUser.id}" onclick="return confirmx('确认要删除该用户中心吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>